/**
 * 操作本地存储
 */

const local = {
  // 存
  set(key, val) {
    window.localStorage.setItem(key, JSON.stringify(val));
  },
  // 取
  get(key) {
    return JSON.parse(window.localStorage.getItem(key));
  },
  // 删
  remove(key) {
    window.localStorage.removeItem(key);
  },
  // 清空
  clear() {
    window.localStorage.clear();
  }
};

export default local;
